package arrays;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Practice9 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		//Peel<Banana>[] pba = new Peel<Banana>[2];
		
		List<Peel<Banana>> pbList = Arrays.asList(new Peel<Banana>(new Banana()));
		System.out.println(pbList);
		
		pbList = new ArrayList<Peel<Banana>>();
		
		for(int i = 0; i < 10; i++){
			pbList.add(new Peel(new Banana()));
		}
		for(Peel<Banana> pb : pbList){
			System.out.println(pb);
		}
		System.out.println(pbList);
		System.out.println("peels.get(0).getClass():" + pbList.get(0).getClass());
		System.out.println(pbList.getClass());
	}

}

class Peel<T>{
	private T t;
	private static int count = 0;
	private final int id = count++;
	
	public Peel(T t){
		this.t = t;
	}
	
	public T getT(){
		return t;
	}
	
	public String toString(){
		return "Peel" + id + t;
	}
}

class Banana{
	private static int count = 0;
	private final int id = ++count;
	
	public String toString(){
		return "Banana" + id;
	}
}
